package com.youfang.sixthmedia.common;

import java.util.Date;

import com.gzit.utils.DateUtil;

public final class YouFangUtils {

	public static String getDistanceDesc(double distance) {

		if (distance == 0) {
			return "";
		}

		if (distance > 1000) {
			return String.format("%.2f公里", distance / 1000);
		}
		return String.format("%.2f米", distance);

	}

	public static String getDateTimeDesc(Date date) {
		if (DateUtil.isToday(date)) {
			return "今天 " + DateUtil.time2String(date);
		}

		return DateUtil.dateTime2String(date);

	}

}
